{extend name="base" /}

{block name="content"}
<form class="layui-form layui-form-my" action="" style="padding-right:20px;">
    <div class="layui-form-item">
        <label class="layui-form-label">游戏名称<span style="color:#ff0000;">（必填）</span></label>
        <div class="layui-input-block">
            <select name="game_id" id="game_id" lay-filter="game_id" lay-verify="required" lay-search="">
                <option value="">请选择游戏</option>
                {volist name="$game_data" id="vo"}
                <option value="{$vo.game_id}">{$vo.game_id}：{$vo.game_name}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所在区服<span style="color:#ff0000;">（必填）</span></label>
        <div class="layui-input-block">
            <input type="text" name="server_name" id="server_name" lay-verify="required" placeholder="请输入所在区服，如：5" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色名称<span style="color:#ff0000;">（必填）</span></label>
        <div class="layui-input-block">
            <input type="text" name="role_name" id="role_name" lay-verify="required" placeholder="请输入角色名称，如：我是米娱大魔王" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色ID（选填）</label>
        <div class="layui-input-block">
            <input type="text" name="role_id" id="role_id" placeholder="请输入角色ID，如：7844313287" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">充值金额<span style="color:#ff0000;">（必填）</span></label>
        <div class="layui-input-block">
            <input type="text" name="pay_money" id="pay_money" lay-verify="required|number" placeholder="请输入充值金额，如：318" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">充值时间<span style="color:#ff0000;">（必填）</span></label>
        <div class="layui-input-block">
            <input type="text" name="pay_time" id="pay_time" lay-verify="required" placeholder="请输入充值时间，如：2018-05-03" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">充值订单号（选填，<span style="color:#ff0000;">IOS用户必填</span>）</label>
        <div class="layui-input-block">
            <input type="text" name="pay_id" id="pay_id" placeholder="请输入充值订单号，如：4564313245781" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注（选填）</label>
        <div class="layui-input-block">
            <textarea name="remark" id="remark" placeholder="请输入备注" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item" style="margin-bottom: 100px;">
        <div class="layui-input-block">
            <button class="layui-btn my-btn" lay-submit="" lay-filter="submitBtn">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary" style="color:#fff; border:none;">重置</button>
        </div>
    </div>
</form>
{/block}

{block name="css"}
<style>
    .layui-form-label {width:250px;}
    .layui-input-block {margin-left:280px;}
</style>
{/block}

{block name="js"}
<script>
    layui.use(['form', 'element', 'jquery'], function(){
        var form = layui.form
            ,$ = layui.$
            ,layer = layui.layer;

        //提交
        form.on('submit(submitBtn)', function(data){
            var load = layer.load();
            $.post('{:url("RebateList/apply")}',data.field, function(json){
                layer.close(load);
                json.code==0 ? layer.msg(json.msg, {icon: 1, time: 3000}) : layer.msg(json.msg, {icon: 0, time: 3000});
            }, 'JSON');
            return false;
        });
    });
</script>
{/block}